package com.zl.aop.service;

import org.springframework.stereotype.Component;

/**
 * @author ZLL
 * @date create in 2018/05/09
 */
@Component
public class ServiceImpl implements IService {

    @Override
    public String sayHello(String name){
        System.out.println(1111);

        if ("xx".equals(name)) {
            int a = 1/0;
        }

        return "hello=>" + name;
    }

    @Override
    public String sayHello2(String name) throws RuntimeException {

        System.out.println(222222);

        if ("1".equals(name)) {
            throw new RuntimeException("this is my exception");
        }
        return name;
    }
}
